﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tec2.GUI.Dialog;
using TecBaseObjects.Interfaces;

namespace Tec2.GUI.Controller {
    public class AuswahlLeistunsberichtController : IController {

        #region Members

        AuswahlLeistungsberichtForm myForm;

        #endregion

        #region Constructor

        public AuswahlLeistunsberichtController(AuswahlLeistungsberichtForm form) {
            this.myForm = form;
        }

        #endregion

        #region Methods

        public void CloseForm(object sender, EventArgs e) {
            this.myForm.Close();
        }

        public void Dispose() {
        }

        public void Save(IBaseObject myObject) {
            throw new NotImplementedException("AuswahlLeistunsberichtController.Save");
        }

        public void SelectAndCloseForm(object sender, EventArgs e) {
            if (this.myForm.SelectedLeistungsbericht != 0) {
                this.myForm.Cancel = false;
                this.myForm.Close();
            }
        }

        public void SelectLeistungsbericht(object sender, EventArgs e) {
            RadioButton rb = sender as RadioButton;
            byte sel = Convert.ToByte(rb.Tag);
            if (rb.Checked) {
                this.myForm.SelectedLeistungsbericht = (TecExtensions.Extensions.tpLeistungsbericht)sel;
            }
        }

        #endregion
        
    }
}
